package com.whmskj.xjlhsc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whmskj.xjlhsc.mapper.SpecialUseRecordMapper;
import com.whmskj.xjlhsc.entity.SpecialUseRecord;
import com.whmskj.xjlhsc.service.SpecialUseRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import lombok.extern.slf4j.Slf4j;
import java.util.List;

/**
 * @author lk
 * @since 2025-06-23 17:03:56
 */
@Service
@Slf4j
public class SpecialUseRecordServiceImpl extends ServiceImpl<SpecialUseRecordMapper, SpecialUseRecord> implements SpecialUseRecordService {

    @Autowired
    private SpecialUseRecordMapper specialUseRecordMapper;

    @Override
    public Page<SpecialUseRecord> findPage(SpecialUseRecord params) {
        Page<SpecialUseRecord> page = new Page<>(1, 10);//TODO 自行处理
        LambdaQueryWrapper<SpecialUseRecord> query = Wrappers.lambdaQuery(SpecialUseRecord.class);
        return specialUseRecordMapper.selectPage(page, query);
    }

    @Override
    public List<SpecialUseRecord> findList(SpecialUseRecord params){
        LambdaQueryWrapper<SpecialUseRecord> query = Wrappers.lambdaQuery(SpecialUseRecord.class);
        return specialUseRecordMapper.selectList(query);
    }

    @Override
    public SpecialUseRecord findById(Long id) {
        return specialUseRecordMapper.selectById(id);
    }

    @Override
    public boolean insert(SpecialUseRecord specialUseRecord) {
        return save(specialUseRecord);
    }

    @Override
    public boolean update(SpecialUseRecord specialUseRecord) {
        return updateById(specialUseRecord);
    }

    @Override
    public int delete(Long id) {
        return specialUseRecordMapper.deleteById(id);
    }

}